function Shape(name) {
    this.name = name;
    }

    function Rectangle(name, width, height) {
        // 调⽤ Shape 构造函数来设置 `name` 属性
        Shape.call(this, name);
        // 为 Rectangle 添加独特属性
        this.width = width;
        this.height = height;
        }

    function Circle(name, radius) {
        // 调⽤ Shape 构造函数来设置 `name` 属性
        Shape.call(this, name);
        // 为 Circle 添加独特属性
        this.radius = radius;
        }

Rectangle.prototype = Object.create(Shape.prototype);
Circle.prototype = Object.create(Shape.prototype);

Rectangle.prototype.constructor = Rectangle;
Circle.prototype.constructor = Circle;

Shape.prototype.logName = function () {
    console.log(`形状名称：${this.name}`);
    };

const rect = new Rectangle("矩形 1", 20, 30);
const circle = new Circle("圆形 1", 15);
rect.logName(); // 输出：形状名称：矩形 1
circle.logName(); 

Rectangle.prototype.logName = function () {
    console.log(`矩形名称：${this.name}`);
    };
    rect.logName(); // 输出：矩形名称：矩形 1
    circle.logName();